package cn.edu.bupt.freewings.forum.front.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.edu.bupt.freewings.forum.common.UserType;
import cn.edu.bupt.freewings.forum.common.ProjectType;
import cn.edu.bupt.freewings.forum.client.rest.ProjectClient;
import cn.edu.bupt.freewings.forum.front.Constants;
import cn.edu.bupt.freewings.forum.front.beans.UserBean;

/**
 * @author hubaiyu (hubaiyu@gmail.com)
 * 
 */
public class HomeController extends HttpServlet {
	@Override
	protected void service(HttpServletRequest request,
			HttpServletResponse response) throws IOException, ServletException {
		ProjectType.ProjectList projects = new ProjectClient()
				.getByParentId(Constants.HOME_PROJECT_PARENT_ID);
		request.setAttribute(Constants.PROJECTS, projects.getProjectList());
		request.getRequestDispatcher("/index.jsp").forward(request, response);
	}
}
